package cn.itcast.service.impl;

import cn.itcast.SysLog;
import cn.itcast.dao.SysLogDao;
import cn.itcast.service.SysLogService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysLogServiceImpl implements SysLogService {

    @Autowired
    private SysLogDao sysLogDao;

    /**
     * 添加日志对象
     * @param sysLog
     */
    @Override
    public void save(SysLog sysLog) {
        sysLogDao.save(sysLog);
    }

    /**
     * 查询所有日志对象
     * @return
     */
    @Override
    public List<SysLog> findAll(int page, int size) {

        PageHelper.startPage(page,size);
        return sysLogDao.findAll();
    }
}
